package ink.onei.production.service.impl;

import ink.onei.production.entity.Goods;
import ink.onei.production.mapper.IGoodsMapper;
import ink.onei.production.service.IGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: nekotako
 * @Description: TODO
 * @Date: 26/12/2023 20:51 Tuesday
 */

@Service
public class GoodsService implements IGoodsService {

    @Autowired
    private IGoodsMapper goodsMapper;

    @Override
    public Integer add(Goods goods) {
        return goodsMapper.insert(goods);
    }

    @Override
    public Integer modify(Goods goods) {
        return goodsMapper.update(goods);
    }

    @Override
    public Integer delete(Goods goods) {
        return goodsMapper.delete(goods);
    }

    public Integer deleteBatch(List<Goods> goodsList) {
        return goodsMapper.deleteBatch(goodsList);
    }

    public Goods getGoods(Goods goods) {
        return goodsMapper.getGoods(goods);
    }

    @Override
    public List<Goods> getGoodsList(Integer id, String name, String type, String status) {
        return goodsMapper.getGoodsList(id, name, type, status);
    }
}
